package ExceptionDemo;

public class TestInput {
    public static void main(String[] args) {

        try {
            new Input().method();
        } catch (WrongInputException wie) {
            System.out.println(wie.getMessage());
        }
    }
}

class WrongInputException extends RuntimeException {
    public WrongInputException(String message) {
        super(message);
    }
}

class Input {
    void method() throws WrongInputException {
        throw new WrongInputException("Wrong input"); // 抛出自定义的类
    }
}
